
<script lang="ts" setup>

import { ref,onMounted } from 'vue'
defineProps({
  // SVG 图标名称
  icon: {
    type: String,
    required: true
  },
  // 图标类名
  className: {
    type: String,
    default: 'icon'
  }
})
const iconUrl = ref('')
onMounted(() => {
  // console.log('左侧树图标---->',icon)
  
  // let iconItem = iconList.find(item => {
  //   return item.name === icon
  // })
  // iconUrl.value = iconItem.iconUrl
})
</script>

<template>
  <svg
    class="svg-icon"
    :class="className"
    aria-hidden="true"
  >
    <use :xlink:href="`#icon-${icon}`" />
  </svg>
</template>

<style scoped lang=scss>
.svg-icon {
  width: 1em;
  height: 1em;
  overflow: hidden;
  fill: currentcolor;
}
</style>
